<?php

namespace backend\models\course;


use Yii;

/**
 * This is the model class for table "edu_learn_log".
 *
 * @property string $id
 * @property string $user_id
 * @property string $course_id
 * @property string $period_id
 * @property string $status
 * @property string $startTime
 * @property string $finishedTime
 * @property string $learnTime
 * @property string $watchTime
 * @property string $watchNum
 * @property string $videoStatus
 * @property string $updateTime
 */
class LearnLog extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'edu_learn_log';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['user_id', 'course_id', 'period_id', 'startTime', 'finishedTime', 'learnTime', 'watchTime', 'watchNum', 'updateTime'], 'integer'],
            [['status', 'videoStatus'], 'string'],
            [['user_id', 'period_id'], 'unique', 'targetAttribute' => ['user_id', 'period_id'], 'message' => 'The combination of User ID and Period ID has already been taken.']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'user_id' => 'User ID',
            'course_id' => 'Course ID',
            'period_id' => 'Period ID',
            'status' => 'Status',
            'startTime' => 'Start Time',
            'finishedTime' => 'Finished Time',
            'learnTime' => 'Learn Time',
            'watchTime' => 'Watch Time',
            'watchNum' => 'Watch Num',
            'videoStatus' => 'Video Status',
            'updateTime' => 'Update Time',
        ];
    }
}
